package com.swan.core.domain;

import cn.hutool.core.util.RandomUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zongf
 * @date 2024-10-15
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserPO {

    private Integer id;

    private String username;

    private String password;

    public static List<UserPO> newList(int size){
        List<UserPO> list = new ArrayList<>();
        for (int i = 0; i <size; i++) {
            list.add(new UserPO(100 + i, RandomUtil.randomString(8), RandomUtil.randomString(6)));
        }
        return list;
    }

    public static List<UserPO> newList(int size, int repeat){
        List<UserPO> subList = new ArrayList<>();
        for (int i = 0; i <size; i++) {
            subList.add(new UserPO(100 + i, RandomUtil.randomString(8), RandomUtil.randomString(6)));
        }

        List<UserPO> allList = new ArrayList<>();
        for (int i = 0; i < repeat; i++) {
            allList.addAll(subList);
        }
        return allList;
    }

}
